<?php

/**
 * AVE.cms - Модуль Поиск
 *
 * @package AVE.cms
 * @subpackage module_Search
 * @filesource
 */

$module_sql_install = array();
$module_sql_deinstall = array();
$module_sql_update = array();

$module_sql_deinstall[] = "DROP TABLE IF EXISTS CPPREFIX_module_search;";

$module_sql_install[] = "CREATE TABLE CPPREFIX_module_search (
  `Id` int(10) unsigned NOT NULL auto_increment,
  `search_query` char(255) NOT NULL,
  `search_count` mediumint(5) unsigned NOT NULL default '0',
  `search_found` mediumint(5) unsigned NOT NULL default '0',
  PRIMARY KEY  (`Id`),
  UNIQUE KEY `search_query` (`search_query`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0;";

// Обновление модуля
$module_sql_update[] = "
  UPDATE
    `CPPREFIX_module`
  SET
    ModuleAveTag = '" . $modul['ModuleAveTag'] . "',
    ModulePHPTag = '" . $modul['ModulePHPTag'] . "',
    ModuleVersion = '" . $modul['ModuleVersion'] . "'
  WHERE
    ModuleSysName = '" . $modul['ModuleSysName'] . "'
  LIMIT 1;
";

$module_sql_update[] = "
  RENAME TABLE
    `CPPREFIX_modul_search`
  TO
    `CPPREFIX_module_search`
";

?>